#ifndef QPERSON_H
#define QPERSON_H

#include <QObject>

class QPerson : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("author", "TerryDeng")
    Q_PROPERTY(unsigned int age READ age WRITE setAge NOTIFY ageChanged)
    Q_PROPERTY(QString name MEMBER m_name)
    Q_PROPERTY(unsigned int score MEMBER m_score)
public:
    explicit QPerson(QObject *parent = nullptr);
    explicit QPerson(QString pName, QObject *parent = nullptr);

    unsigned int age();
    void setAge(unsigned int);
    void incAge();

private:

    unsigned int m_age;
    QString m_name;
    unsigned int m_score;

signals:
    void ageChanged(int);// 1. must return void. 2. no impl. 3. with parameter type
};

#endif // QPERSON_H
